/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ShopAppsetHome extends BasicModel<ShopAppsetHome> {
  name?: string; // 描述
  cversion?: number; // 版本
  fbStatus?: string; // 发布状态
}

export const shopAppsetHomeList = (params?: ShopAppsetHome | any) =>
  defHttp.get<ShopAppsetHome>({ url: adminPath + '/shop/sethome/shopAppsetHome/list', params });

export const shopAppsetHomeListData = (params?: ShopAppsetHome | any) =>
  defHttp.post<Page<ShopAppsetHome>>({
    url: adminPath + '/shop/sethome/shopAppsetHome/listData',
    params,
  });

export const shopAppsetHomeForm = (params?: ShopAppsetHome | any) =>
  defHttp.get<ShopAppsetHome>({ url: adminPath + '/shop/sethome/shopAppsetHome/form', params });

export const shopAppsetHomeSave = (params?: any, data?: ShopAppsetHome | any) =>
  defHttp.postJson<ShopAppsetHome>({
    url: adminPath + '/shop/sethome/shopAppsetHome/save',
    params,
    data,
  });

export const shopAppsetHomeDisable = (params?: ShopAppsetHome | any) =>
  defHttp.get<ShopAppsetHome>({ url: adminPath + '/shop/sethome/shopAppsetHome/disable', params });

export const shopAppsetHomeEnable = (params?: ShopAppsetHome | any) =>
  defHttp.get<ShopAppsetHome>({ url: adminPath + '/shop/sethome/shopAppsetHome/enable', params });

export const shopAppsetHomeDelete = (params?: ShopAppsetHome | any) =>
  defHttp.get<ShopAppsetHome>({ url: adminPath + '/shop/sethome/shopAppsetHome/delete', params });

export const publishHome = (params?: any, data?: ShopAppsetHome | any) =>
  defHttp.postJson<ShopAppsetHome>({
    url: adminPath + '/shop/sethome/shopAppsetHome/publishHome',
    params,
    data,
  });
